package cn.smbms.service;

import cn.smbms.dao.BillMapper;
import cn.smbms.dao.ProviderMapper;
import cn.smbms.pojo.Bill;
import cn.smbms.pojo.Provider;
import com.alibaba.fastjson.JSONArray;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

@Service
public class ProviderServiceImpl implements ProviderService {

    @Resource
    private ProviderMapper providerMapper;

    @Override
    public List<Provider> getProList() {
        return providerMapper.getProList();
    }

    @Override
    public List<Provider> getProListlimit(String proCode,
                                     String proName,
                                     Integer currentPageNo,
                                     Integer pageSize) {
        return providerMapper.getProListlimit(proCode,proName,currentPageNo,pageSize);
    }

    @Override
    public Integer getProviderCount(String proCode, String proName) {
        return providerMapper.getProviderCount(proCode,proName);
    }

    @Override
    public Provider getById(Integer id) {
        return providerMapper.getById(id);
    }

    @Override
    public boolean delete(Integer id) {
        return providerMapper.delete(id) > 0 ? true : false;
    }

    @Override
    public boolean modify(Provider provider) {
        return providerMapper.modify(provider) > 0 ? true : false;
    }

    @Override
    public boolean add(Provider provider) {
        return providerMapper.add(provider)> 0 ? true : false;
    }


}
